%This is a function using the FFT funcion to calculate a signal's Fourier
%Translation
%input is the time and the signal vertors,the length of time must greater
%Output is the frequency and the signal spectrum
%N = length(s);
function [f, sf] = T2F(s, fs)
    N = length(s);
    
    f  = (-fs/2 : fs/2-1)/fs*N;
    sf = fftshift(abs(fft(s, fs)))/N;
end